/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-12-14 13:41:52
 * @LastEditTime: 2025-06-12 19:56:40
 * @FilePath: /monitor_belt/src/views/image/column.tsx
 */
import DictionaryLabel from "@/components/dictionary_label";
import { alarmTypes } from "@/utils/dictionary";

export const columns = (deal: Function) => [
  {
    title: "序号",
    dataIndex: "key",
    render: (_text: any, _row: any, index: number) => index + 1,
    width: 80,
  },
  {
    title: "视频",
    dataIndex: "file_path",
    render: (_text: string) => {
      return _text ? <video height={70} src={_text} autoPlay={false} controls></video> : null;
    },
  },
  {
    title: "报警类型",
    dataIndex: "alarm_type",
    ellipsis: true,
    render: (_text: any) => (
      <DictionaryLabel list={[...alarmTypes]} label={"label"} value={_text} />
    ),
  },
  {
    title: "设备名称",
    dataIndex: "device",
    ellipsis: true,
  },
  {
    title: "输送线名称",
    dataIndex: "conveyor",
    ellipsis: true,
  },
  {
    title: "日期",
    dataIndex: "date",
    ellipsis: true,
  },
  {
    title: "生成时间",
    dataIndex: "create_time",
    ellipsis: true,
  },
  // {
  //   title: "操作",
  //   dataIndex: "action",
  //   width: 100,
  //   render: (_text: any, _row: any, _index: number) => (
  //     <Flex>
  //       {_row.state == AlarmStatusEnum.UNCONFIRM ? (
  //         <Button size="small" type="link" danger onClick={()=>deal(_row,TAction.RELEASE)}>
  //           解除预警
  //         </Button>
  //       ) : null}
  //     </Flex>
  //   ),
  // },
];
